<?php
/***************************************************************
*  Copyright notice
*
*  (c) 2011 Florian Müller <it-admin@ifp-potsdam.co>, IFP
*  
*  All rights reserved
*
*  This script is part of the TYPO3 project. The TYPO3 project is
*  free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 3 of the License, or
*  (at your option) any later version.
*
*  The GNU General Public License can be found at
*  http://www.gnu.org/copyleft/gpl.html.
*
*  This script is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/

/**
 * Ausbildungsschema
 */
class Tx_IfpCurriculum2_Domain_Model_Ausbildungsschema extends Tx_Extbase_DomainObject_AbstractEntity {

	/**
	 * kurz
	 *
	 * @var string
	 * 
	 */
	protected $kurz;
	/**
	 * Name
	 *
	 * @var string
	 * @validate NotEmpty
	 */
	protected $name;
	
	/**
	 * Beschreibung
	 *
	 * @var string
	 */
	protected $beschreibung;

	/**
	 * Ausbildungsabschluss
	 *
	 * @var string
	 */
	protected $abschluss;

	/**
	 * Richtung
	 *
	 * @var string
	 */
	protected $richtung;

	/**
	 * Standard
	 *
	 * @var boolean
	 */
	protected $standard;

	/**
	 * Enthalten
	 *
	 * @var Tx_Extbase_Persistence_ObjectStorage<Tx_IfpCurriculum2_Domain_Model_Kursstamm>
	 */
	protected $enthaelt;
	/**
	 * 
	 * Enter description here ...
	 * @var integer
	 */
	protected $detailpage;


	public function __construct() {
		//Do not remove the next line: It would break the functionality
		$this->initStorageObjects();
	}

	/**
	 * Initializes all Tx_Extbase_Persistence_ObjectStorage instances.
	 *
	 * @return void
	 */
	protected function initStorageObjects() {
		/**
		* Do not modify this method!
		* It will be rewritten on each save in the kickstarter
		* You may modify the constructor of this class instead
		*/
		$this->enthaelt = new Tx_Extbase_Persistence_ObjectStorage();
	}

/**
	 * @param string $kurz
	 * @return void
	 */
	public function setKurz($kurz) {
		$this->kurz = $kurz;
	}

	/**
	 * @return string
	 */
	public function getkurz() {
		return $this->kurz;
	}
	
	/**
	 * @param string $name
	 * @return void
	 */
	public function setName($name) {
		$this->name = $name;
	}

	/**
	 * @return string
	 */
	public function getName() {
		return $this->name;
	}
/**
	 * @param string $beschreibung
	 * @return void
	 */
	public function setBeschreibung($beschreibung) {
		$this->beschreibung = $beschreibung;
	}

	/**
	 * @return string
	 */
	public function getBeschreibung() {
		return $this->beschreibung;
	}
	/**
	 * @param string $abschluss
	 * @return void
	 */
	public function setAbschluss($abschluss) {
		$this->abschluss = $abschluss;
	}

	/**
	 * @return string
	 */
	public function getAbschluss() {
		return $this->abschluss;
	}

	/**
	 * @param string $richtung
	 * @return void
	 */
	public function setRichtung($richtung) {
		$this->richtung = $richtung;
	}

	/**
	 * @return string
	 */
	public function getRichtung() {
		return $this->richtung;
	}

	/**
	 * @param boolean $standard
	 * @return void
	 */
	public function setStandard($standard) {
		$this->standard = $standard;
	}

	/**
	 * @return boolean
	 */
	public function getStandard() {
		return $this->standard;
	}

	/**
	 * @return boolean
	 */
	public function isStandard() {
		return $this->getStandard();
	}

	/**
	 * @param Tx_Extbase_Persistence_ObjectStorage<Tx_IfpCurriculum2_Domain_Model_Kursstamm> $enthaelt
	 * @return void
	 */
	public function setEnthaelt(Tx_Extbase_Persistence_ObjectStorage $enthaelt) {
		$this->enthaelt = $enthaelt;
	}

	/**
	 * @return Tx_Extbase_Persistence_ObjectStorage<Tx_IfpCurriculum2_Domain_Model_Kursstamm>
	 */
	public function getEnthaelt() {
		return $this->enthaelt;
	}

	/**
	 * @param Tx_IfpCurriculum2_Domain_Model_Kursstamm the Kursstamm to be added
	 * @return void
	 */
	public function addEnthaelt(Tx_IfpCurriculum2_Domain_Model_Kursstamm $enthaelt) {
		$this->enthaelt->attach($enthaelt);
	}

	/**
	 * @param Tx_IfpCurriculum2_Domain_Model_Kursstamm the Kursstamm to be removed
	 * @return void
	 */
	public function removeEnthaelt(Tx_IfpCurriculum2_Domain_Model_Kursstamm $enthaeltToRemove) {
		$this->enthaelt->detach($enthaeltToRemove);
	}
	
	public function getText(){
		$standard="";
		if($this->getStandard()){
			$standard="(S)";
		}
		return $this->getName()." (".$this->abschluss.") ".$standard;
	}
	
	public function getTextkurz(){
		if($this->kurz){
			return $this->kurz. " (".$this->abschluss.") ".$standard;
		}else{
			return substr($this->getName(), 0,17)." (".$this->abschluss.") ".$standard;
		}
	}
	/**
	 * 
	 * @return integer
	 */
	public function getDetailpage(){
		return $this->detailpage;
	}
	
	public function setDetailpage($detailpage){
		$this->detailpage=$detailpage;
	}

}
?>